There is no guarantee that the gtk_surface won't be NULL,
and Wayland API does not safeguard against NULL, so we have
to do that ourselves here.
We were also mistakenly cheking for the surface version off
by one, fix that too by checking if the surface version is
equal or greater.
gdk_wayland_window_supports_edge_constraints (GdkWindow *window)
{
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
+ struct gtk_surface1 *gtk_surface = impl->display_server.gtk_surface;
- return gtk_surface1_get_version (impl->display_server.gtk_surface) > GTK_SURFACE1_CONFIGURE_EDGES_SINCE_VERSION;
+ if (!gtk_surface)
+ return FALSE;
+
+ return gtk_surface1_get_version (gtk_surface) >= GTK_SURFACE1_CONFIGURE_EDGES_SINCE_VERSION;
}
static void